package thread_safe;

/**
 * @Description: 双重检查实现懒汉式中的线程安全问题测试类
 * @Author: WangBlue
 * @Create: 2024-09-23 15:06
 * @Version: 1.0
 **/

public class DoubleSafeMain {
    public static void main(String[] args) {
        DoubleSafe ds = DoubleSafe.getInstance();
        DoubleSafe ds1 = DoubleSafe.getInstance();
        System.out.println("使用双重检查解决懒汉式中的线程安全问题");
        if (ds == ds1) {
            System.out.println("这两个是同一个实例对象");
        }
    }
}
